package com.kd.service.product;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kd.common.PageResult;
import com.kd.dao.ProductMapper;
import com.kd.entity.Product;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
@Service
public interface ProductService extends IService<Product> {

    Product findProductById(Integer pid);
    boolean insertProduct(Product product);
    PageResult<Product,Integer> findProductsWithFilters(
            Integer cursor,
            Integer limit,
            Integer pid,
            String name,
            Integer sidefork,
            Integer panelLeg,
            Integer customize,
            Integer bottomlayer,
            Integer leglayout,
            Integer boardwing,
            String structure,
            Integer blockheight,
            BigDecimal minPrice,
            BigDecimal maxPrice);
    PageResult<Product,Integer> findProductsWithFilters(
            Integer cursor,
            Integer limit,
            Integer pid);

    boolean updateProduct(Product product);

    Product matchProduct(Product productParam);
    public PageResult<ProductMapper.ProductStats, Integer> getProductStats(
            Integer cursor,
            Integer limit,
            boolean isNextPage);
}
